Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Managing Renderers

QuickDraw 3D provides routines that you can use to create and manage instances of a renderer.

Q3Renderer_NewFromType

You can use the Q3Renderer_NewFromType function to create an instance of a certain type of renderer.

TQ3RendererObject Q3Renderer_NewFromType (
                     TQ3ObjectType rendererObjectType);
rendererObjectType
A value that specifies a renderer type.

DESCRIPTION

The Q3Renderer_NewFromType function returns, as its function result, a new renderer of the type specified by the rendererObjectType parameter. You can use these values to specify QuickDraw 3D's wireframe and interactive renderers:

kQ3RendererTypeWireFrame
kQ3RendererTypeInteractive

You can also pass the value kQ3RendererTypeGeneric to create a generic renderer. A generic renderer does not render any image, but you can use it to collect state information.

If Q3Renderer_NewFromType is not able to create an instance of the specified renderer type, it returns NULL .

SPECIAL CONSIDERATIONS

You should create a renderer object once and associate it with a view (by calling Q3View_SetRenderer ); you should not create a new renderer object for each frame.

SEE ALSO

You can call the Q3View_SetRendererByType function to create a new renderer of a specified type and attach it to a view. See the chapter "View Objects" for complete information.

Q3Renderer_GetType

You can use the Q3Renderer_GetType function to get the type of a renderer.

TQ3ObjectType Q3Renderer_GetType (TQ3RendererObject renderer);
renderer
A renderer.

DESCRIPTION

The Q3Renderer_GetType function returns, as its function result, the type of the renderer object specified by the renderer parameter. The types of renderer objects currently supported by QuickDraw 3D are defined by these constants:

kQ3RendererTypeWireFrame
kQ3RendererTypeGeneric
kQ3RendererTypeInteractive

If the specified renderer object is invalid or is not one of these types, Q3Renderer_GetType returns the value kQ3ObjectTypeInvalid .


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |